package com.github.thinwonton.showcase.springboot.basic.anno.enablexx.enableasync;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

class AsyncTaskApplication {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(TaskExecutorConfigurer.class);
        AsyncTaskService asyncTaskService = applicationContext.getBean(AsyncTaskService.class);

        for (int i = 0; i < 10; i++) {
            asyncTaskService.executeAsyncTask1(i);
            asyncTaskService.executeAsyncTask2(i);
        }

        applicationContext.close();
    }
}
